#!/bin/ksh
#--------------------------------------------------------------------------
#
# LINUX Only.
#
# Main script to unconfigure websm.  Typically called from an rpm package
#
#--------------------------------------------------------------------------

# If we are called from Security then we just remove the security directory
# and leave

if [ $# -gt 0 ] ; then

  if [ "$1" = "Security" ] ; then
     rm -rf /var/websm/security
     exit $?
  fi
  exit
fi

# Disable wsmserver
if [ -f /usr/websm/bin/wsmserver ]; then
   /usr/websm/bin/wsmserver -disable
fi

# Add websm to the inittab
if [ -f /usr/websm/bin/rc.websm ]; then
   /usr/websm/bin/rc.websm -disable
fi

# Configure websm to work with pam
if [ -f /usr/websm/bin/wsmpamconfig ]; then
   /usr/websm/bin/wsmpamconfig -disable
fi


if [ -f /usr/websm/html/wsmship ]; then
  rm /usr/websm/html/wsmship
fi

if [ -d /usr/websm/codebase/rsd ]; then
  rmdir /usr/websm/codebase/rsd
fi

if [ -d /usr/websm/codebase/pluginjars ]; then
  rmdir /usr/websm/codebase/pluginjars
fi

if [ -f /opt/websm ]; then
  rm /opt/websm
fi

rm /usr/websm/codebase/sguide
#rm /usr/websm/codebase/taskguide/taskguide
rm /usr/websm/html/codebase
rm /usr/websm/websm.cfg
rm /var/websm/websm.script
rm /usr/websm/bin/wsmrefresh
rm /usr/bin/configassist
rm /usr/bin/wsm



